home *** CD-ROM | disk | FTP | other *** search
- /* Plug-in module utility routines */
-
- /* Copyright 1993-95 by Adobe Systems, Inc. All rights reserved. */
-
- /* The routines in this module provide a collection of utilities for doing
- * things like centering dialogs, etc.. They expect that the host's A5-world
- * is the currently active A5-world.
- */
-
- #ifndef __DialogUtilities__
- #define __DialogUtilities__
-
- #include <Dialogs.h>
- #include <stddef.h>
- #include <Types.h>
-
- #include "PIGeneral.h"
-
- /*****************************************************************************/
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- /*****************************************************************************/
-
- /* Set the cursor to the arrow cursor. */
-
- void SetArrowCursor ();
-
- /*****************************************************************************/
-
- /* Centers a dialog template 1/3 of the way down on the main screen. */
-
- void CenterDialog (DialogTHndl dt);
-
- /* The following routine sets up a moveable modal dialog. */
-
- void SetUpMoveableModal (DialogTHndl dt, OSType hostSig);
-
- /* The following routine takes the place of ModalDialog in running moveable
- * modal dialogs.
- */
-
- void MoveableModalDialog (DialogPtr dp,
- ProcessEventProc processEvent,
- ModalFilterProcPtr filter,
- short *item);
-
- /* Except within the filter procedure for such moveable modal dialogs, we need
- to call the following routine to get the window refcon since
- MoveableModalDialog stomps it. */
-
- long GetMoveableWRefCon (DialogPtr dp);
-
- /* The following routine displays a centered alert. */
-
- short ShowAlert (short alertID);
-
- /* The following routine displays a standard about box dialog. */
-
- void ShowAbout (short dialogID);
-
- /*****************************************************************************/
-
- /* The following routine sets a user item to be a group box. It expects
- the next item to be the title for the group box. */
-
- void SetOutlineGroup (DialogPtr dp, short groupItem);
-
- /*****************************************************************************/
-
- /* The following routine selects an edit text item. */
-
- void SelectTextItem (DialogPtr dp, short item);
-
- /* The following routine sets the text of a text item. */
-
- void StuffText (DialogPtr dp, short item, Str255 text);
-
- /* The following routine extracts the text of a text item. */
-
- void FetchText (DialogPtr dp, short item, Str255 text);
-
- /* The following routine stuffs a numeric value into a text field. */
-
- void StuffNumber (DialogPtr dp, short item, long value);
-
- /* Here is the corresponding routine to retrieve the value from a text
- field. It will do range checking and validate that it has been
- handed a number. If it has not been handed a number, it brings up
- an appropriate error dialog, inserts an appropriately pinned value,
- and selects the item.
-
- It returns TRUE iff it gets a valid value in the field. */
-
- Boolean FetchNumber (DialogPtr dp,
- short item,
- long min,
- long max,
- long *value);
-
- /*****************************************************************************/
-
- /* Set the state of a check box (or radio button). */
-
- void SetCheckBoxState (DialogPtr dp, short item, Boolean checkIt);
-
- /* Determine the state of a check box (or radio button). */
-
- Boolean GetCheckBoxState (DialogPtr dp, short item);
-
- /* Toggle a check box and return the new state. */
-
- Boolean ToggleCheckBoxState (DialogPtr dp, short item);
-
- /* Set a radio group (from first to last item) to reflect the selection. */
-
- void SetRadioGroupState (DialogPtr dp, short first, short last, short item);
-
- /* Get the selected button within a radio group. */
-
- short GetRadioGroupState (DialogPtr dp, short first, short last);
-
- /* Set the value for a pop-up menu. */
-
- void SetPopUpMenuValue (DialogPtr dp, short item, short newValue);
-
- /* Get the value for a pop-up menu. */
-
- short GetPopUpMenuValue (DialogPtr dp, short item);
-
- /* Utility routine to disable a control. */
-
- void DisableControl (DialogPtr dp, short item);
-
- /* Utility routine to enable a control. */
-
- void EnableControl (DialogPtr dp, short item);
-
- /* Utility routine to enable (TRUE) or disable (FALSE) a control. */
-
- void EnableDisableControl (DialogPtr dp, short item, Boolean state);
-
- /* Utility routine to invalidate an item. */
-
- void InvalItem (DialogPtr dp, short item);
-
- /*****************************************************************************/
-
- /* Perform standard handling for check boxes and radio buttons. For radio
- buttons, we assume that the group for the radio button extends forward
- and backward in the DITL as long as the item type is radio button. */
-
- void PerformStandardDialogItemHandling (DialogPtr dp, short item);
-
- /*****************************************************************************/
-
- #ifdef __cplusplus
- } /* End of extern "C" block. */
- #endif
-
- /*****************************************************************************/
-
- #endif /* __DialogUtilities__ */
-